#!/bin/sh

if [ $# -eq 0 ] 
then
	echo "Usage: $0 <g|c|a> [action]";
	exit;
fi

if ! [ -z $2 ]
then
	target=$2
else
	target=''
fi

if [ $1 = 'g' ]
then
	mf=go.Makefile
elif [ $1 = 'c' ]
then
	mf=cpp.Makefile
elif [ $1 = 'a' ]
then
	for mf in *.Makefile
	do
		make -f $mf $target
	done
	exit;
else 
	echo "Invalid option $1."
	exit;
fi

make -f $mf $target
